home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Process.java < prev    next >
Text File  |  1998-09-22  |  3KB  |  98 lines

  1. /*
  2.  * @(#)Process.java    1.11 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.lang;
  16.  
  17. import java.io.*;
  18.  
  19. /** 
  20.  * The <code>exec</code> methods return an 
  21.  * instance of a subclass of <code>Process</code> that can be used to 
  22.  * control the process and obtain information about it. 
  23.  * <p>
  24.  * The subprocess is not killed when there are no more references to 
  25.  * the <code>Process</code> object, but rather the subprocess 
  26.  * continues executing asynchronously. 
  27.  *
  28.  * @author  unascribed
  29.  * @version 1.11, 07/01/98
  30.  * @see     java.lang.Runtime#exec(java.lang.String)
  31.  * @see     java.lang.Runtime#exec(java.lang.String, java.lang.String[])
  32.  * @see     java.lang.Runtime#exec(java.lang.String[])
  33.  * @see     java.lang.Runtime#exec(java.lang.String[], java.lang.String[])
  34.  * @since   JDK1.0
  35.  */
  36. public abstract class Process 
  37. {
  38.     /**
  39.      * Gets the output stream of the subprocess.
  40.      * This stream is usually buffered.
  41.      *
  42.      * @return  the output stream connected to the normal input of the
  43.      *          subprocess.
  44.      * @since   JDK1.0
  45.      */
  46.     abstract public OutputStream getOutputStream();
  47.  
  48.     /** 
  49.      * Gets the input stream of the subprocess.
  50.      * This stream is usually buffered.
  51.      *
  52.      * @return  the input stream connected to the normal output of the
  53.      *          subprocess.
  54.      * @since   JDK1.0
  55.      */
  56.     abstract public InputStream getInputStream();
  57.  
  58.     /**
  59.      * Gets the error stream of the subprocess.
  60.      * This stream is usually unbuffered.
  61.      *
  62.      * @return  the input stream connected to the error stream of the
  63.      *          subprocess.
  64.      * @since   JDK1.0
  65.      */
  66.     abstract public InputStream getErrorStream();
  67.  
  68.     /**
  69.      * Waits for the subprocess to complete. This method returns 
  70.      * immediately if the subprocess has already terminated. If the
  71.      * subprocess has not yet terminated, the calling thread will be
  72.      * blocked until the subprocess exits.
  73.      *
  74.      * @return     the exit value of the process.
  75.      * @exception  InterruptedException  if the <code>waitFor</code> was
  76.      *               interrupted.
  77.      * @since      JDK1.0
  78.      */
  79.     abstract public int waitFor() throws InterruptedException;
  80.  
  81.     /**
  82.      * Returns the exit value for the subprocess.
  83.      *
  84.      * @return  the exit value of the subprocess.
  85.      * @exception  IllegalThreadStateException  if the subprocess has not yet
  86.      *               terminated.
  87.      * @since      JDK1.0
  88.      */
  89.     abstract public int exitValue();
  90.  
  91.     /**
  92.      * Kills the subprocess. 
  93.      *
  94.      * @since   JDK1.0
  95.      */
  96.     abstract public void destroy();
  97. }
  98.